home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / DMTDEMOS / GETATTR.DEM < prev    next >
Text File  |  1994-07-02  |  1KB  |  53 lines

  1. program GetAttrSample;
  2.  
  3.  uses crt, DMT;
  4.  
  5.  var
  6.    Attributes : word;
  7.  
  8.    FileName   : string;
  9.  
  10. begin
  11.   Color( 7, 0 );
  12.   clrscr;
  13.  
  14.   write( 'Get attributes for, Enter filename : ' );
  15.   readln( FileName );
  16.  
  17.   GetAttr( FileName, Attributes );    { Call GetAttr procedure }
  18.  
  19.   if ( ErrFlag ) then
  20.     begin
  21.       writeln( #7 );
  22.       writeln( ShowError( GetErrCode ) );
  23.     end
  24.   else
  25.     begin
  26.       writeln;
  27.       writeln( 'Current Attributes: ' );
  28.       writeln;
  29.  
  30.       if ( Attributes and $20 ) = $20 then
  31.         writeln( ' Archive' );             { Backup required }
  32.  
  33.       if ( Attributes and $10 ) = $10 then
  34.         writeln( ' Subdirectory' );
  35.  
  36.       if ( Attributes and $02 ) = $02 then
  37.         writeln( ' Hidden' );
  38.  
  39.       if ( Attributes and $01 ) = $01 then
  40.         writeln( ' Read-Only' );
  41.  
  42.       if ( Attributes and $04 ) = $04 then
  43.         writeln( ' System' );
  44.  
  45.       if ( Attributes and $08 ) = $08 then
  46.         writeln( ' Volume Label' );
  47.  
  48.       if ( Attributes = $00 ) then
  49.         writeln( ' Normal' );
  50.     end;
  51.  
  52.   GetEnter;
  53. end.